home *** CD-ROM | disk | FTP | other *** search
/ 130 MIDI Tool Box / 130 MIDI Tool Box.iso / mpu401c / mpuput.c < prev    next >
C/C++ Source or Header  |  1986-11-02  |  534b  |  28 lines

  1. /* Copyright (C) 1986 by M. J. Shannon, Jr.
  2. ** Permission to distribute for non-commercial uses granted as long as this
  3. ** notice is retained.  Violators will be prosecuted.
  4. */
  5.  
  6. #include    "mpu.h"
  7.  
  8. /* mpu_put(byte):
  9. **    put out a single byte command & wait for the ack.
  10. */
  11.  
  12. void
  13. mpu_put(cmd)
  14. unsigned char cmd;
  15. {
  16.     long counter;
  17.  
  18.     (void) mpu_drr();
  19.     outp(MPUP_COMD, cmd);
  20.     for (counter = 0xFFL; counter != 0; --counter)
  21.     {
  22.         if (mpu_dsr())        /* timed out */
  23.             break;
  24.         if (mpu_dget() == CMD_ACK)
  25.             break;
  26.     }
  27. }
  28.